package com.example.bootdemo.recursion1;

public class RecursionTest1 {
    public static void main(String[] args) {
      test(8);
        System.out.println(factorial(3));
    }

  public static void test(int n){
        if (n==1){
            return;
        }
      System.out.println("n="+n);
        test(n-1);
      System.out.println("n1="+n);
    }
    public static int factorial(int n){
        if (n==1){
            return 1;
        }
        return factorial(n-1)*n;

    }
}
